﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace Spencen.Mobile.UI.Easings
{
    public class SineWaveEasing : IEasingFunction
    {
        #region IEasingFunction Members

        public float EasedValue( float actualValue )
        {
            float adjustedValue;
            if ( actualValue < 0.5f )
                adjustedValue = 0.5f - (float)Math.Cos( actualValue * Math.PI ) * 0.5f;
            else
                adjustedValue = (float)Math.Cos( actualValue * Math.PI ) * -0.5f + 0.5f;
            return adjustedValue;
        }

        #endregion
    }
}
